package cn.edu.Day06.service.Impl;

import cn.edu.Day06.Entity.Plane;
import cn.edu.Day06.service.PlaneService;

import java.awt.event.MouseEvent;

public class PlaneServiceImpl implements PlaneService {
    public Plane createPlane() {
        Plane plane = new Plane();
        plane.setWidth(80);
        plane.setHeight(60);
        return plane;
    }
    public void move(Plane plane, MouseEvent mouseEvent) {
        plane.setX(mouseEvent.getX()-plane.getWidth()/2);
        plane.setY(mouseEvent.getY()-plane.getHeight()/3);
    }

}
